package result;

import java.util.Map;

import org.apache.struts2.json.annotations.JSON;

import com.opensymphony.xwork2.ActionContext;

public class ValidateAction {
	private String validateCode="";
	private boolean ok=false;
	public String execute(){
		Map<String,Object> session = ActionContext.getContext().getSession();
		String scode=(String) session.get("validateCode");
		if(scode.equals(validateCode))
			ok=true;
		return "success";
	}
	//@JSON(name="myok")//修改拼json字符串时ok值对应的key
	public boolean isOk() {
		return ok;
	}
	@JSON(serialize=false)//防止code值参与json串行化返回
	public String getValidateCode() {
		return validateCode;
	}
	public void setValidateCode(String validateCode) {
		this.validateCode = validateCode;
	}
	public void setOk(boolean ok) {
		this.ok = ok;
	}
}
